package com.ouc.tcp.test;

import com.ouc.tcp.client.Client;
import com.ouc.tcp.message.TCP_PACKET;

import java.util.TimerTask;

public class Window  {
    public Client client;//客户端
    public int size = 5000;//窗口大小
    //存放分组
    public TCP_PACKET[] packets = new TCP_PACKET[size]; 
    //三个窗口指针
    public volatile int base = 0;
    public volatile int nextseqnum = 0;
    public volatile int end = size - 1;
    
    public boolean[] isAck = new boolean[size];//对应分组是否有了ACK

    public Window(Client client) {//构造函数
        this.client = client;
    }
    public boolean isFull() {
        return nextseqnum >= end;
    }
}
